package org.feng.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.context.annotation.Bean;

/**
 * 自动配置类：在META-INF中不做配置时，会抛出警告 <code>Application context not configured for this file</code>
 *
 * @version V1.0
 * @author: fengjinsong
 * @date: 2023年02月02日 10时03分
 */
@AutoConfiguration
public class AppInfoConfiguration {
    @Value("${app.url.baiDu}")
    private String baiDuUrl;

    public String getBaiDuUrl() {
        return baiDuUrl;
    }

    public void setBaiDuUrl(String baiDuUrl) {
        this.baiDuUrl = baiDuUrl;
    }

    @Bean
    public AppUrl generateAppUrl() {
        AppUrl appUrl = new AppUrl();
        appUrl.setBaidu(baiDuUrl);
        return appUrl;
    }
}
